home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Programming / AmigaE / Src / Rkrm / Math / spieee.e < prev    next >
Text File  |  1995-09-20  |  868b  |  33 lines

  1. -> spieee.e - Math SP IEEE example of SPMul().
  2.  
  3. ->>> Header (globals)
  4. MODULE 'mathieeesingbas'
  5.  
  6. ENUM ERR_NONE, ERR_LIB
  7.  
  8. RAISE ERR_LIB IF OpenLibrary()=NIL
  9.  
  10. CONST STRSIZE=10, ACC=5
  11. ->>>
  12.  
  13. ->>> PROC main()
  14. PROC main() HANDLE
  15.   -> E-Note: IEEE single is the format used for reals in E
  16.   DEF mul1=-3.6, mul2=18.7  -> 3.6 multiplied by 18.7
  17.   DEF result, s[STRSIZE]:STRING
  18.   mathieeesingbasbase:=OpenLibrary('mathieeesingbas.library', 34)
  19.   result:=IeeeSPMul(mul1, mul2)
  20.   -> E-Note: alternatively, no need to open library, use:  result:=!mul1*mul2
  21.   WriteF(RealF(s, mul1, ACC))
  22.   WriteF(' multiplied by ')
  23.   WriteF(RealF(s, mul2, ACC))
  24.   WriteF(' = \s\n', RealF(s, result, ACC))
  25. EXCEPT DO
  26.   IF mathieeesingbasbase THEN CloseLibrary(mathieeesingbasbase)
  27.   SELECT exception
  28.   CASE ERR_LIB;  WriteF('Error: could not open mathieeesingbas library\n')
  29.   ENDSELECT
  30. ENDPROC
  31. ->>>
  32.  
  33.